﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using ZhCun.Framework.Common.Helpers;
using ZhCun.Framework.Common.CurrentStatus;

namespace ZhCun.Framework.Common
{
    public class Configurations
    {
        /// <summary>
        /// 获得指定key的连接字符串
        /// </summary>
        /// <param name="keyName"></param>
        /// <returns></returns>
        public static string GetConnectString(string keyName)
        {
            ConnectionStringSettings conn = ConfigurationManager.ConnectionStrings[keyName];
            return conn.ConnectionString;
        }
        /// <summary>
        /// 获得指定key的配置项
        /// </summary>
        public static string GetAppSettings(string keyName)
        {
            string configValue = System.Configuration.ConfigurationManager.AppSettings[keyName];
            return configValue;
        }
    }
}
